package my.li.zhcsfrontmanger.controller;

import Vo.Land;
import page.PageBean;
import land.LandFeignInterfance;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import util.JsonResult;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.ArrayList;
import java.util.List;

@Controller
@RequestMapping("/land")
public class LandController {
    private LandFeignInterfance landFeignInterfance;
    @RequestMapping("/")
    @ResponseBody
    public String test(){
        System.out.println("do");
        return "ok";
    }
    @RequestMapping("/getAll")
    public String getAllMes(PageBean pageBean, HttpServletRequest request){
        System.out.println("======================= 进行分页查询");
        HttpSession session = request.getSession();
        session.setAttribute("pagebean",pageBean);
//        landFeignInterfance.queryAll(pageBean);
        List<Land> lands = new ArrayList<>();
        session.setAttribute("lands",lands);
        return "area_manager";
    }

    @RequestMapping("/getById")
    @ResponseBody
    public String queryById(Land land){
//        util.JsonResult jsonResult = new util.JsonResult();
        System.out.println("land :  "+land);
      return "ok";
    }


    @RequestMapping("/add")
    @ResponseBody
    public JsonResult addLand(Land land ){
        JsonResult jsonResult = new JsonResult();
        System.out.println("add : "+land);
        return jsonResult;
    }

    @RequestMapping("area_add")
    public String getAdd(Land land){
        //查询
        return "area_add";
    }

    @RequestMapping("deleteById")
    public String deleteByLandId(Land land){

        return "ok";
    }

}
